1. Field of the Invention
The present invention relates to a management technique of a storage medium, and particularly relates to a memory management method and a controller for a non-volatile memory storage device.
2. Description of Related Art
In recent years, consumers' demand for storage media has been surging as digital cameras, mobile phones with built-in digital cameras, MP3 players, and MP4 players are rapidly developed. Compared with other storage media, a flash memory has the characteristics of non-volatile data storage, low power consumption, small size, and non-mechanical structure, and is therefore an ideal built-in memory for the above portable multimedia storage devices. In addition, to satisfy the growing demands for detachable small-size memory cards and flash memory devices, manufacturers in this field all work on developing flash memories with larger capacity and higher use/management stability.
At present, a flash memory is generally collocated with a controller to form a flash memory storage device. It is known that the controller will sequentially read all the data stored in a sector of the start page of each block in the flash memory when the flash memory storage device is powered. Accordingly, the controller establishes the logical-to-physical mapping table of each block by a memory buffer (generally a SRAM) inside the controller. Thereby, the host which uses the flash memory storage device can receive the logical-to-physical mapping relationship of each block in the flash memory for accessing data from the flash memory storage device.
Generally speaking, a sector usually includes a user data area having a memory capacity of 512 bytes for storing user data; a system management area having a memory capacity of 6 bytes for storing system management data; and an error correction area having a memory capacity of 10 bytes for storing error correction codes (ECC). Herein, the content of the logical-to-physical mapping relationship of the blocks is usually stored in the system management area.
It can be known from the above that the controller needs to read all the data stored in a sector of the start page of each block in the flash memory so as to establish the logical-to-physical mapping table of each block in the memory buffer of the controller. However, as the memory capacity of a flash memory increases (i.e. the number of the blocks increases), this method reduces the management efficiency of the flash memory storage device (i.e. the speed of establishing the logical-to-physical mapping table becomes very slow).
Moreover, because of the advance of semiconductor technology, multi level cell (MLC) flash memories have been developed from single level cell (SLC) flash memories to increase memory capacity. However, the error correction code of the MLC flash memory requires a memory capacity up to 10 bytes or above. Consequently, the memory capacity of all the system management areas within the start page is reduced to less than 6 bytes, which is insufficient for each system management area.